package com.supermarket.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.supermarket.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<User> {
    User selectById(Long id);
    List<User> selectAll();
    int insert(User user);
    int update(User user);
    int deleteById(Long id);
    User getByUserCode(String userCode);
    
    List<User> getUserList(@Param("start") int start, 
                          @Param("pageSize") Integer pageSize, 
                          @Param("userCode") String userCode,
                          @Param("userName") String userName);
                          
    int getUserCount(@Param("userCode") String userCode,
                    @Param("userName") String userName);
}
